<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<script type="text/javascript" src="../js/jquery-3.5.1.min.js"></script>
<script>
    function getId() {
        var id = $("#id").val();
        var url = window.location.search; //获取url中"?"符后的字串
        if (url.indexOf("?") != -1) {
            id = url.substr(url.indexOf("=") + 1);
        }
        return id;
    }

    function pay(){
        $.ajax({
            type: "POST",
            url: "http://188.131.243.12/seckill/pay",
            data: {"id":getId()},
            success: function (data) {
                alert(data.msg);
                window.location.href="login.html";
            }
        });
    }

</script>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>支付</title>
</head>
<body>
    <input id="id" type="hidden" value="${id}"/>
    <button id="pay" onclick="pay()">支付</button>
</body>
</html>